using System;
using UnityEngine;

[Serializable]
public class GameStatistics
{
	public int shots;

	public int pottedBalls;

	public int maxCombo;

	public int quickFireHighScore;

	public int quickFireHighRound;

	public int missionStars;

	public int cueballPottedCount;

	public int cueballHitNoBallCount;

	public int cueballHitRailCount;

	public int cueballHitBallCount;

	public int pottedJiangyouBallCount;

	public int AIBattleWins;

	public int AIBattleCount;

	public static void Serialize()
	{
		if (ConstantData.gameStatisticsData != null)
		{
			//StreamTools.SerializeObject(ConstantData.gameStatisticsData, ConstantData.gameStatisticsDataPath);
			string json = JsonUtility.ToJson(ConstantData.gameStatisticsData);
			PlayerPrefs.SetString("GameStatistics", json);
			PlayerPrefs.Save();
		}
	}

	public static void MarkPottedJiangyouBallCount(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.pottedJiangyouBallCount += value;
		}
	}

	public static void MarkAIBattleWins(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.AIBattleWins += value;
		}
	}

	public static void MarkAIBattleCount(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.AIBattleCount += value;
		}
	}

	public static void MarkShot(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.shots += value;
		}
	}

	public static void MarkPottedBalls(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.pottedBalls += value;
		}
	}

	public static void MarkMaxCombo(int value)
	{
		if (ConstantData.gameStatisticsData != null && ConstantData.gameStatisticsData.maxCombo < value)
		{
			ConstantData.gameStatisticsData.maxCombo = value;
		}
	}

	public static void MarkQuickFireHighScore(int value)
	{
		if (ConstantData.gameStatisticsData != null && ConstantData.gameStatisticsData.quickFireHighScore < value)
		{
			ConstantData.gameStatisticsData.quickFireHighScore = value;
		}
	}

	public static void MarkQuickFireHighRound(int value)
	{
		if (ConstantData.gameStatisticsData != null && ConstantData.gameStatisticsData.quickFireHighRound < value)
		{
			ConstantData.gameStatisticsData.quickFireHighRound = value;
		}
	}

	public static void MarkMissionStars(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.missionStars += value;
		}
	}

	public static void MarkCueballHitNoBall(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.cueballHitNoBallCount += value;
		}
	}

	public static void MarkCueballPotted(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.cueballPottedCount += value;
		}
	}

	public static void MarkCueballHitRail(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.cueballHitRailCount += value;
		}
	}

	public static void MarkCueballHitBall(int value)
	{
		if (ConstantData.gameStatisticsData != null)
		{
			ConstantData.gameStatisticsData.cueballHitBallCount += value;
		}
	}
}
